Optimal. Leaf size=480 \[ \frac{b^2 d \text{PolyLog}\left (2,-\frac{c+d x+1}{-c-d x+1}\right )}{2 f (-c f+d e+f)}+\frac{b^2 d \text{PolyLog}\left (2,1-\frac{2}{c+d x+1}\right )}{2 f (-c f+d e-f)}-\frac{b^2 d \text{PolyLog}\left (2,1-\frac{2}{c+d x+1}\right )}{(-c f+d e+f) (d e-(c+1) f)}+\frac{b^2 d \text{PolyLog}\left (2,1-\frac{2 d (e+f x)}{(c+d x+1) (-c f+d e+f)}\right )}{(-c f+d e+f) (d e-(c+1) f)}+\frac{2 a b d \log (e+f x)}{f^2-(d e-c f)^2}-\frac{a b d \log (-c-d x+1)}{f (-c f+d e+f)}+\frac{a b d \log (c+d x+1)}{f (-c f+d e-f)}-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{b^2 d \log \left (\frac{2}{-c-d x+1}\right ) \tanh ^{-1}(c+d x)}{f (-c f+d e+f)}-\frac{b^2 d \log \left (\frac{2}{c+d x+1}\right ) \tanh ^{-1}(c+d x)}{f (-c f+d e-f)}+\frac{2 b^2 d \log \left (\frac{2}{c+d x+1}\right ) \tanh ^{-1}(c+d x)}{(-c f+d e+f) (d e-(c+1) f)}-\frac{2 b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2 d (e+f x)}{(c+d x+1) (-c f+d e+f)}\right )}{(-c f+d e+f) (d e-(c+1) f)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.71296, antiderivative size = 485, normalized size of antiderivative = 1.01, number of steps used = 21, number of rules used = 19, integrand size = 20, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.95, Rules used = {6109, 1982, 705, 31, 632, 6741, 6121, 706, 633, 6688, 12, 6725, 72, 6742, 5918, 2402, 2315, 5920, 2447} \[ \frac{b^2 d \text{PolyLog}\left (2,-\frac{c+d x+1}{-c-d x+1}\right )}{2 f (-c f+d e+f)}+\frac{b^2 d \text{PolyLog}\left (2,1-\frac{2}{c+d x+1}\right )}{2 f (-c f+d e-f)}-\frac{b^2 d \text{PolyLog}\left (2,1-\frac{2}{c+d x+1}\right )}{(-c f+d e+f) (d e-(c+1) f)}+\frac{b^2 d \text{PolyLog}\left (2,1-\frac{2 d (e+f x)}{(c+d x+1) (-c f+d e+f)}\right )}{(-c f+d e+f) (d e-(c+1) f)}-\frac{a b d \log (-c-d x+1)}{f (-c f+d e+f)}+\frac{a b d \log (c+d x+1)}{f (-c f+d e-f)}-\frac{2 a b d \log (e+f x)}{(-c f+d e+f) (d e-(c+1) f)}-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{b^2 d \log \left (\frac{2}{-c-d x+1}\right ) \tanh ^{-1}(c+d x)}{f (-c f+d e+f)}-\frac{b^2 d \log \left (\frac{2}{c+d x+1}\right ) \tanh ^{-1}(c+d x)}{f (-c f+d e-f)}+\frac{2 b^2 d \log \left (\frac{2}{c+d x+1}\right ) \tanh ^{-1}(c+d x)}{(-c f+d e+f) (d e-(c+1) f)}-\frac{2 b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2 d (e+f x)}{(c+d x+1) (-c f+d e+f)}\right )}{(-c f+d e+f) (d e-(c+1) f)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6109
Rule 1982
Rule 705
Rule 31
Rule 632
Rule 6741
Rule 6121
Rule 706
Rule 633
Rule 6688
Rule 12
Rule 6725
Rule 72
Rule 6742
Rule 5918
Rule 2402
Rule 2315
Rule 5920
Rule 2447
Rubi steps
\begin{align*} \int \frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{(e+f x)^2} \, dx &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{(2 b d) \int \frac{a+b \tanh ^{-1}(c+d x)}{(e+f x) \left (1-(c+d x)^2\right )} \, dx}{f}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{(2 b d) \int \frac{a+b \tanh ^{-1}(c+d x)}{(e+f x) \left (1-c^2-2 c d x-d^2 x^2\right )} \, dx}{f}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{(2 b) \operatorname{Subst}\left (\int \frac{a+b \tanh ^{-1}(x)}{\left (\frac{d e-c f}{d}+\frac{f x}{d}\right ) \left (1-x^2\right )} \, dx,x,c+d x\right )}{f}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{(2 b) \operatorname{Subst}\left (\int \frac{d \left (a+b \tanh ^{-1}(x)\right )}{(d e-c f+f x) \left (1-x^2\right )} \, dx,x,c+d x\right )}{f}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{(2 b d) \operatorname{Subst}\left (\int \frac{a+b \tanh ^{-1}(x)}{(d e-c f+f x) \left (1-x^2\right )} \, dx,x,c+d x\right )}{f}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{(2 b d) \operatorname{Subst}\left (\int \left (-\frac{a}{(-1+x) (1+x) (d e-c f+f x)}-\frac{b \tanh ^{-1}(x)}{(-1+x) (1+x) (d e-c f+f x)}\right ) \, dx,x,c+d x\right )}{f}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac{(2 a b d) \operatorname{Subst}\left (\int \frac{1}{(-1+x) (1+x) (d e-c f+f x)} \, dx,x,c+d x\right )}{f}-\frac{\left (2 b^2 d\right ) \operatorname{Subst}\left (\int \frac{\tanh ^{-1}(x)}{(-1+x) (1+x) (d e-c f+f x)} \, dx,x,c+d x\right )}{f}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac{(2 a b d) \operatorname{Subst}\left (\int \left (\frac{1}{2 (d e+f-c f) (-1+x)}+\frac{1}{2 (-d e+(1+c) f) (1+x)}+\frac{f^2}{(d e+(1-c) f) (d e-f-c f) (d e-c f+f x)}\right ) \, dx,x,c+d x\right )}{f}-\frac{\left (2 b^2 d\right ) \operatorname{Subst}\left (\int \left (\frac{\tanh ^{-1}(x)}{2 (d e+f-c f) (-1+x)}+\frac{\tanh ^{-1}(x)}{2 (-d e+(1+c) f) (1+x)}+\frac{f^2 \tanh ^{-1}(x)}{(d e+(1-c) f) (d e-f-c f) (d e-c f+f x)}\right ) \, dx,x,c+d x\right )}{f}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}-\frac{a b d \log (1-c-d x)}{f (d e+f-c f)}+\frac{a b d \log (1+c+d x)}{f (d e-f-c f)}-\frac{2 a b d \log (e+f x)}{(d e+f-c f) (d e-(1+c) f)}+\frac{\left (b^2 d\right ) \operatorname{Subst}\left (\int \frac{\tanh ^{-1}(x)}{1+x} \, dx,x,c+d x\right )}{f (d e-f-c f)}-\frac{\left (b^2 d\right ) \operatorname{Subst}\left (\int \frac{\tanh ^{-1}(x)}{-1+x} \, dx,x,c+d x\right )}{f (d e+f-c f)}-\frac{\left (2 b^2 d f\right ) \operatorname{Subst}\left (\int \frac{\tanh ^{-1}(x)}{d e-c f+f x} \, dx,x,c+d x\right )}{(d e+f-c f) (d e-(1+c) f)}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1-c-d x}\right )}{f (d e+f-c f)}-\frac{a b d \log (1-c-d x)}{f (d e+f-c f)}-\frac{b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1+c+d x}\right )}{f (d e-f-c f)}+\frac{2 b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1+c+d x}\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{a b d \log (1+c+d x)}{f (d e-f-c f)}-\frac{2 a b d \log (e+f x)}{(d e+f-c f) (d e-(1+c) f)}-\frac{2 b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2 d (e+f x)}{(d e+f-c f) (1+c+d x)}\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{\left (b^2 d\right ) \operatorname{Subst}\left (\int \frac{\log \left (\frac{2}{1+x}\right )}{1-x^2} \, dx,x,c+d x\right )}{f (d e-f-c f)}-\frac{\left (b^2 d\right ) \operatorname{Subst}\left (\int \frac{\log \left (\frac{2}{1-x}\right )}{1-x^2} \, dx,x,c+d x\right )}{f (d e+f-c f)}-\frac{\left (2 b^2 d\right ) \operatorname{Subst}\left (\int \frac{\log \left (\frac{2}{1+x}\right )}{1-x^2} \, dx,x,c+d x\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{\left (2 b^2 d\right ) \operatorname{Subst}\left (\int \frac{\log \left (\frac{2 (d e-c f+f x)}{(d e+f-c f) (1+x)}\right )}{1-x^2} \, dx,x,c+d x\right )}{(d e+f-c f) (d e-(1+c) f)}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1-c-d x}\right )}{f (d e+f-c f)}-\frac{a b d \log (1-c-d x)}{f (d e+f-c f)}-\frac{b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1+c+d x}\right )}{f (d e-f-c f)}+\frac{2 b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1+c+d x}\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{a b d \log (1+c+d x)}{f (d e-f-c f)}-\frac{2 a b d \log (e+f x)}{(d e+f-c f) (d e-(1+c) f)}-\frac{2 b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2 d (e+f x)}{(d e+f-c f) (1+c+d x)}\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{b^2 d \text{Li}_2\left (1-\frac{2 d (e+f x)}{(d e+f-c f) (1+c+d x)}\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{\left (b^2 d\right ) \operatorname{Subst}\left (\int \frac{\log (2 x)}{1-2 x} \, dx,x,\frac{1}{1+c+d x}\right )}{f (d e-f-c f)}+\frac{\left (b^2 d\right ) \operatorname{Subst}\left (\int \frac{\log (2 x)}{1-2 x} \, dx,x,\frac{1}{1-c-d x}\right )}{f (d e+f-c f)}-\frac{\left (2 b^2 d\right ) \operatorname{Subst}\left (\int \frac{\log (2 x)}{1-2 x} \, dx,x,\frac{1}{1+c+d x}\right )}{(d e+f-c f) (d e-(1+c) f)}\\ &=-\frac{\left (a+b \tanh ^{-1}(c+d x)\right )^2}{f (e+f x)}+\frac{b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1-c-d x}\right )}{f (d e+f-c f)}-\frac{a b d \log (1-c-d x)}{f (d e+f-c f)}-\frac{b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1+c+d x}\right )}{f (d e-f-c f)}+\frac{2 b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2}{1+c+d x}\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{a b d \log (1+c+d x)}{f (d e-f-c f)}-\frac{2 a b d \log (e+f x)}{(d e+f-c f) (d e-(1+c) f)}-\frac{2 b^2 d \tanh ^{-1}(c+d x) \log \left (\frac{2 d (e+f x)}{(d e+f-c f) (1+c+d x)}\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{b^2 d \text{Li}_2\left (1-\frac{2}{1-c-d x}\right )}{2 f (d e+f-c f)}+\frac{b^2 d \text{Li}_2\left (1-\frac{2}{1+c+d x}\right )}{2 f (d e-f-c f)}-\frac{b^2 d \text{Li}_2\left (1-\frac{2}{1+c+d x}\right )}{(d e+f-c f) (d e-(1+c) f)}+\frac{b^2 d \text{Li}_2\left (1-\frac{2 d (e+f x)}{(d e+f-c f) (1+c+d x)}\right )}{(d e+f-c f) (d e-(1+c) f)}\\ \end{align*}
Mathematica [C] time = 7.45192, size = 425, normalized size = 0.89 \[ \frac{\frac{b^2 d (e+f x) \left (\frac{(d e-c f) \left (\text{PolyLog}\left (2,\exp \left (-2 \left (\tanh ^{-1}\left (\frac{d e-c f}{f}\right )+\tanh ^{-1}(c+d x)\right )\right )\right )-2 \tanh ^{-1}(c+d x) \log \left (1-\exp \left (-2 \left (\tanh ^{-1}\left (\frac{d e-c f}{f}\right )+\tanh ^{-1}(c+d x)\right )\right )\right )-2 \tanh ^{-1}\left (\frac{d e-c f}{f}\right ) \left (\log \left (1-\exp \left (-2 \left (\tanh ^{-1}\left (\frac{d e-c f}{f}\right )+\tanh ^{-1}(c+d x)\right )\right )\right )-\log \left (i \sinh \left (\tanh ^{-1}\left (\frac{d e-c f}{f}\right )+\tanh ^{-1}(c+d x)\right )\right )+\tanh ^{-1}(c+d x)\right )+i \pi \log \left (e^{2 \tanh ^{-1}(c+d x)}+1\right )-i \pi \left (\log \left (\frac{1}{\sqrt{1-(c+d x)^2}}\right )+\tanh ^{-1}(c+d x)\right )\right )}{\left (c^2-1\right ) f^2-2 c d e f+d^2 e^2}-\frac{\tanh ^{-1}(c+d x)^2 e^{-\tanh ^{-1}\left (\frac{d e-c f}{f}\right )}}{f \sqrt{1-\frac{(d e-c f)^2}{f^2}}}+\frac{(c+d x) \tanh ^{-1}(c+d x)^2}{d (e+f x)}\right )}{d e-c f}-\frac{a^2}{f}+\frac{2 a b \left (\tanh ^{-1}(c+d x) \left (c^2 (-f)+c d (e-f x)+d^2 e x+f\right )-d (e+f x) \log \left (\frac{d (e+f x)}{\sqrt{1-(c+d x)^2}}\right )\right )}{(-c f+d e+f) (d e-(c+1) f)}}{e+f x} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.168, size = 783, normalized size = 1.6 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\left (d{\left (\frac{\log \left (d x + c + 1\right )}{d e f -{\left (c + 1\right )} f^{2}} - \frac{\log \left (d x + c - 1\right )}{d e f -{\left (c - 1\right )} f^{2}} - \frac{2 \, \log \left (f x + e\right )}{d^{2} e^{2} - 2 \, c d e f +{\left (c^{2} - 1\right )} f^{2}}\right )} - \frac{2 \, \operatorname{artanh}\left (d x + c\right )}{f^{2} x + e f}\right )} a b - \frac{1}{4} \, b^{2}{\left (\frac{\log \left (-d x - c + 1\right )^{2}}{f^{2} x + e f} + \int -\frac{{\left (d f x + c f - f\right )} \log \left (d x + c + 1\right )^{2} + 2 \,{\left (d f x + d e -{\left (d f x + c f - f\right )} \log \left (d x + c + 1\right )\right )} \log \left (-d x - c + 1\right )}{d f^{3} x^{3} + c e^{2} f - e^{2} f +{\left (2 \, d e f^{2} + c f^{3} - f^{3}\right )} x^{2} +{\left (d e^{2} f + 2 \, c e f^{2} - 2 \, e f^{2}\right )} x}\,{d x}\right )} - \frac{a^{2}}{f^{2} x + e f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{b^{2} \operatorname{artanh}\left (d x + c\right )^{2} + 2 \, a b \operatorname{artanh}\left (d x + c\right ) + a^{2}}{f^{2} x^{2} + 2 \, e f x + e^{2}}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b \operatorname{artanh}\left (d x + c\right ) + a\right )}^{2}}{{\left (f x + e\right )}^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]